<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script type="text/javascript">
        var bianhao = parseInt(prompt("您想加什么油？填写92或97"));
        var sheng = parseFloat(prompt("您想加多少升？"));
        if (bianhao == 92) {
            if (sheng >= 20) {
                var price = sheng * 5.9;
            } else {
                var price = sheng * 6;
            }
        } else if (bianhao == 97) {
            if (sheng >= 30) {
                var price = sheng * 6.95;
            } else {
                var price = sheng * 7;
            }
        }
        alert("价格是" + price);
    </script>
</body>

</html>